import request from '@/utils/request'

// 创建仓库信息
export function createWarehouse(data) {
  return request({
    url: '/hs/warehouse/create',
    method: 'post',
    data: data
  })
}

// 更新仓库信息
export function updateWarehouse(data) {
  return request({
    url: '/hs/warehouse/update',
    method: 'put',
    data: data
  })
}

// 获取仓库精简信息列表
export function getWarehouseSimpleList(query) {
  return request({
    url: '/hs/warehouse/simple-list',
    method: 'get',
    params: query
  })
}

// 删除仓库信息
export function deleteWarehouse(id) {
  return request({
    url: '/hs/warehouse/delete?id=' + id,
    method: 'delete'
  })
}

// 获得仓库信息
export function getWarehouse(id) {
  return request({
    url: '/hs/warehouse/get?id=' + id,
    method: 'get'
  })
}

// 获得仓库信息分页
export function getWarehousePage(params) {
  return request({
    url: '/hs/warehouse/page',
    method: 'get',
    params
  })
}

// 导出仓库信息 Excel
export function exportWarehouseExcel(params) {
  return request({
    url: '/hs/warehouse/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
